def  is_prime(n):
    if n == 2:
        return True
    elif n < 2 or n%2 == 0:
        return False
    for i in range(3,int(n**0.5)+1,2):
        if n %i == 0:
            return False
    return True

def find_n(a,b):
    n = 0
    while is_prime(n*n+a*n+b):
        n+=1
        return n

am,bm,num=0,0,0
for b in range(3,1000):
    if is_prime(b):
        for a in range(-999,1000,1):
            tmp = find_n(a,b)
            if tmp>num:
                am,bm,num = a,b,tmp

print(f"{am}*{bm}={am*bm}")







